# -*- coding=UTF-8 -*- f

from Tkinter import *
import time
import threading

def interface_init():
	print 'init'
	global root

def root_mainloop():
        global root
	root.mainloop()
		

def update():
	global root
	global val
	
	while True:
		l['text']=str(time.ctime())
		root.update()
		time.sleep(0.1)
	
if __name__ == '__main__':

	root=Tk()
	val=str(time.ctime())
	l=Label(root, text=val, bg="green", font=("Arial", 12),\
		width=100, height=20)
	l.pack()
	print 'here'
	threads=[]
	threads.append(threading.Thread(target=interface_init))
	threads.append(threading.Thread(target=update))

	for t in threads:
		t.setDaemon(True)
		t.start()
	t.join()

